{extend name="platform/base" /} {block name="main"}
	<div class="padder-v">
		<form class="form-horizontal">
			<section class="panel panel-default">
				<header class="panel-heading font-bold"> 订单信息 </header>
				<div class="panel-body">
					<form class="form-horizontal">
						<div class="form-group">
							<label class="col-md-2 control-label">订单号</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.order_no}</p>
							</div>
							<label class="col-md-2 control-label">订单状态</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.status_name}</p>
							</div>
							<label class="col-md-2 control-label">订单总额</label>
							<div class="col-md-4">
								<p class="form-control-static" style="color:#ff5400;">
								
										<!-- 积分兑换 -->
										{if condition="$order['order_type']==6"}
											<span>商品总积分：{$order['point']} 积分，</span>	
											<span> 实际需支付：<b class="real-pay c-red">{$order['point']}</b> 积分</span>
										{else/}
										
											<span>商品总金额：￥{$order['goods_money']}，{$order['point_exchange_type']}</span>				
											{if condition="$order['user_platform_money']>0"}
											<span>余额支付：￥{$order['user_platform_money']}，</span>
											{/if}
											
											{if condition="$order['coupon_money']>0"}
											<span>优惠券：￥{$order['coupon_money']}，</span>
											{/if}
											
											{if condition="$order['tax_money']>0"}
											<span>发票税额：￥{$order['tax_money']}，</span>
											{/if}
											
											{if condition="$order['promotion_money']>0"}
											<span>满减优惠：￥{$order['promotion_money']}，</span>
											{/if}
											<span> 实际需支付：<b class="real-pay c-red">￥{$order['order_money']}</b></span>
											<span>（含运费 ￥{$order['shipping_money']}）</span>
										
										{/if}
														
								</p>
							</div>
							<label class="col-md-2 control-label">运费</label>
							<div class="col-md-4">
								<p class="form-control-static">￥ {$order.shipping_money}</p>
							</div>
						</div>
						<div class="line line-dashed line-lg pull-in"></div>
						<div class="form-group">
							<label class="col-md-2 control-label">买家</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.user_name}</p>
							</div>
							<label class="col-md-2 control-label">店铺</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.shop_name}</p>
							</div>
							<label class="col-md-2 control-label">支付方式</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.payment_type_name}</p>
							</div>
							<label class="col-md-2 control-label">下单时间</label>
							<div class="col-md-4">
								<p class="form-control-static">{:getTimeStampTurnTime($order.create_time)}</p>
							</div>
							<label class="col-md-2 control-label">支付时间</label>
							<div class="col-md-4">
								<p class="form-control-static">{:getTimeStampTurnTime($order.pay_time)}</p>
							</div>
							<label class="col-md-2 control-label">完成时间</label>
							<div class="col-md-4">
								<p class="form-control-static">{:getTimeStampTurnTime($order.finish_time)}</p>
							</div>
						</div>
					</form>
				</div>
			</section>
			<section class="panel panel-default">
				<header class="panel-heading font-bold"> 收货人信息 </header>
				<div class="panel-body">
					<form class="form-horizontal">
						<div class="form-group">
							<label class="col-md-2 control-label">收货人姓名</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.receiver_name}</p>
							</div>
							<label class="col-md-2 control-label">电话号码</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order.receiver_mobile}</p>
							</div>
							<label class="col-md-2 control-label">详细地址</label>
							<div class="col-md-4">
								<p class="form-control-static">{$order['address']}</p>
							</div>
							<label class="col-md-2 control-label"></label>
							<div class="col-md-4">
								<p class="form-control-static"> </p>
							</div>
						</div>
					</form>
				</div>
			</section>
<!-- 			<section class="panel panel-default"> -->
<!-- 				<header class="panel-heading font-bold"> 发货信息 </header> -->
<!-- 				<div class="panel-body"> -->
<!-- 					<form class="form-horizontal"> -->
<!-- 						<div class="form-group"> -->
<!-- 							<label class="col-md-2 control-label">发货人</label> -->
<!-- 							<div class="col-md-4"> -->
<!-- 								<p class="form-control-static"> </p> -->
<!-- 							</div> -->
<!-- 							<label class="col-md-2 control-label">电话号码</label> -->
<!-- 							<div class="col-md-4"> -->
<!-- 								<p class="form-control-static"> </p> -->
<!-- 							</div> -->
<!-- 							<label class="col-md-2 control-label">发货地</label> -->
<!-- 							<div class="col-md-4"> -->
<!-- 								<p class="form-control-static"> </p> -->
<!-- 							</div> -->
<!-- 						</div> -->
<!-- 					</form> -->
<!-- 				</div> -->
<!-- 			</section> -->

					<section class="panel panel-default">
						<div class="table-responsive">
							<table class="table table-striped b-light text-sm">
								<thead>
									<tr>
										<th style="width:8%;">商品图</th>
										<th style="width:55%;">商品</th>
										{if condition="$order['order_type']==6"}
										<th style="width:10%;">积分</th>
										{else/}
										<th style="width:10%;">金额(元)</th>
										{/if}
										<th style="width:10%;">数量</th>
										{if condition="$order['order_type']==6"}
										<th style="width:10%;">小计(积分)</th>
										{else/}
										<th style="width:10%;">小计(元)</th>
										{/if}
										<th style="width:10%;">配送状态</th>
									</tr>
								</thead>
								<tbody>
								
								
								
								
								
									<!-- 待发货商品 -->
									{if $order['order_goods_no_delive']}
										{volist name="order['order_goods_no_delive']" id="vo"}
											<tr class="test-item">
												<td class="td-goods-image" rowspan="1">
													<div class="ui-centered-image" style="width: 48px; height: 48px;">
														<img src="{:__IMG($vo['picture_info']['pic_cover_micro'])}" style="max-width: 48px; max-height: 48px;">
													</div>
												</td>
												<td class="cell-10" style="width:200px;">
													<a href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$vo['goods_id'])}" target="_blank">{$vo['goods_name']}</a>
													<p class="c-gray">{$vo['sku_name']}</p>
												</td>
												
												<td>
												{if condition="$order['order_type']==6"}
												{$vo['point']}
												{else/}
												{$vo['price']}
												{/if}
												</td>
												<td>{$vo['num']}</td>
												<td>
												{if condition="$order['order_type']==6"}
												{$vo['point']*$vo['num']}
												{else/}
												{$vo['goods_money']}
												{/if}
												</td>
												
												<td>
													{$vo['shipping_status_name']}
												</td>
											</tr>
											<tr><td colspan="9"></td></tr>
										{/volist}
									{/if}
									<!-- 已发货 -->
									{if $order['goods_packet_list']}
										{volist name="order['goods_packet_list']" id="v" key=key}
											<tr style="background-color:#f2f2f2;color:#999;font-weight:bold;">
											<td colspan="6">
											<a href="javascript:;" style="color:rgba(34, 34, 34, 0.71);font-size:14px;">{$v['packet_name']}</a>&nbsp;&nbsp;&nbsp;&nbsp;
											{if condition="$v['is_express'] eq 1"}
												{$v['express_name']}&nbsp;&nbsp;运单号:{$v['express_code']}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" data-html="true" class="logistics-tracking" data-container="body" data_express="{$v['express_name']}" data-placement="top" data-trigger="manual" goods_id="{$v['express_id']}" data-show="1">物流跟踪</a>
											{/if}
											</td>
											
											</tr>
											{volist name="$v['order_goods_list']" id="vo"}
											<tr class="test-item">
												<td class="td-goods-image" rowspan="1">
													<div class="ui-centered-image" style="width: 48px; height: 48px;">
														<img src="{:__IMG($vo['picture_info']['pic_cover_micro'])}" style="max-width: 48px; max-height: 48px;">
													</div>
												</td>
												<td class="cell-10" style="width:200px;">
													<a href="{:__URL('SHOP_MAIN/goods/goodsinfo','goodsid='.$vo['goods_id'])}" target="_blank">{$vo['goods_name']}</a>
													<p class="c-gray">{$vo['sku_name']}</p>
												</td>
												<td>
													{if condition="$order['order_type']==6"}
													{$vo['point']}
													{else/}
													{$vo['price']}
													{/if}
												</td>
												<td>{$vo['num']}</td>
												<td>
													{if condition="$order['order_type']==6"}
													{$vo['point']*$vo['num']}
													{else/}
													{$vo['goods_money']}
													{/if}
												</td>
												
												<td>
													{$vo['shipping_status_name']}
												</td>
											</tr>
											{/volist}
										{/volist}
									{/if}
								
								
								
<!-- 								
								<tr style="background-color:#f2f2f2;color:#999;font-weight:bold;">
								<td colspan="6">
								<a href="javascript:;" style="color:rgba(34, 34, 34, 0.71);font-size:14px;">{$v['packet_name']}</a>&nbsp;&nbsp;&nbsp;&nbsp;
								{if condition="$v['is_express'] eq 1"}
									{$v['express_name']}&nbsp;&nbsp;运单号:{$v['express_code']}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" data-html="true" class="logistics-tracking" data-container="body" data_express="{$v['express_name']}" data-placement="top" data-trigger="manual" goods_id="{$v['express_id']}" data-show="1">物流跟踪</a>
								{/if}
								</td>
								
								</tr>
								
								{foreach name="$order['order_goods']" item="v"}
									<tr>
										<td>
											<img alt="" src="__ROOT__/{$v.picture_info.pic_cover_micro}">
											<span>{$v.goods_name}</span>
										</td>
										<td>￥ {$v['price']}</td>
										<td>{$v['num']}</td>
									</tr>
								{/foreach} -->
								
								
								
								
								</tbody>
							</table>
						</div>
					</section>
			<section class="panel panel-default">
				<header class="panel-heading font-bold"> 操作历史 </header>
				<div class="panel-body">
					<div class="col-sm-12">
						<div class="list-group bg-white">
							{foreach name="$order.order_action" item="vo"}
								<span class="list-group-item"> 操作： {$vo.action} &nbsp;&nbsp;&nbsp;操作人：{$vo.user_name}&nbsp;&nbsp;&nbsp; 操作时间：{:getTimeStampTurnTime($vo.action_time)}</span>
							{/foreach}
						</div>
					</div>
				</div>
			</section>
		</form>
	</div>
	
<script type="text/javascript">
$(function(){
	//查询物流
	$(".logistics-tracking").mouseover(function(){
		$(".logistics-tracking").removeAttr("data-show");
		$(this).attr("data-show",1);
	});
	var html = '';
	$(".logistics-tracking").hover(function(){
		
		var curr = $(this);
		var order_goods_id = curr.attr('goods_id');
		var express_name = curr.attr('data_express');
		$.ajax({
			type : "post",
			url : "{:__URL('PLATFORM_MAIN/order/getexpressinfo')}",
			data : {"order_goods_id":order_goods_id},
			beforeSend : function(){
				html = '<div class="silider-express">';
				html += '<div class="mask-layer-loading" style="text-align:center;">';
				html += '<img src="ADMIN_IMG/mask_load.gif"/>';
				html += '<div style="text-align:center;margin-top:10px;">努力加载中...</div>';
				html += '</div>';
				html += '</div>';
				$(".logistics-tracking").popover({content : html});
				curr.popover("show");
			},
			success : function(data) {
				if(data["Success"]){
					html = '<div class="silider-express">';
					html += '<div class="express_names">快递公司:'+express_name+'</div>';
					html += '<div>';
					html += '<div>物流跟踪：</div>';
					if (data["Traces"].length > 0) {
						for (var i = 0; i < data["Traces"].length; i++){
								html += '<p style="width:76%;float:left;">'+ data["Traces"][i]["AcceptStation"]+'</p>';
								html += '<p style="width:24%;float:right;">'+ data["Traces"][i]["AcceptTime"]+'</p>';
						}
					} 
					html += '</div>';
			 		html += '</div>';
				}else{
					html = '<div class="silider-express">'+ data["Reason"] +'</div>';
				}
		 		curr.popover("destroy");
				curr.popover({content : html});
				curr.popover("show");
			}
		});
	},function(){
		$(this).popover("hide");
	});
	
})
</script>	
	
{/block}


